home *** CD-ROM | disk | FTP | other *** search
- #pragma once
-
- #include "TrapLib.h"
-
- /* use these typedefs when calculating argument and return value sizes */
- typedef short PatchBooleanParameter;
- typedef short PatchCharParameter;
- typedef short PatchByteParameter;
-
- /* data needed by a patch */
- typedef struct PatchType {
- struct PatchType *next; /* next patch */
- pascal void (*addr)(...); /* address of patch routine */
- pascal void (*trap)(...); /* saved trap address */
- long argsize; /* size of arguments */
- long retsize; /* size of return value */
- short num; /* number of trap */
- TrapType type; /* type of trap */
- Boolean skip; /* if true, skip trap */
- Boolean installed; /* true if patch was installed */
- long globalreg; /* value of global variable base register */
- void *data; /* application defined data */
- /* ... followed by code to execute patch ... */
- } PatchType;
-
- void PatchInstall(PatchType *patch);
- void PatchRemove(PatchType *patch);
- PatchType *PatchBegin(void *addr, short num,
- long argsize, long retsize, void *data);
- void PatchEnd(PatchType *patch);
-